package com.coder4j.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 用户拦截器，获取到登录的用户信息，放入ThreadLocal中
 * @author keller
 * @date 2024-5-16 14:29:26
 */
@Slf4j
@Component
public class UserInterceptor implements HandlerInterceptor {



    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        log.info("----------UserInterceptor--{}",request.getRequestURI());
        return true;
    }
}
